﻿using BattleFury.Lib.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace BattleFury.Lib.Screens
{
    public abstract class Screen
        : Entity, IScreen
    {
        public ScreenCollection Screens { get; set; }
        public double Elapsed { get; set; }

        public ContentManager Content
        {
            get { return RenderEngine.Get().Content; }
        }

        protected Screen()
        {
            Elapsed = 0;
        }

        public virtual void LoadContent()
        {

        }

        public new virtual void Update(GameTime gameTime)
        {
            if (!IsEnabled) return;
            Elapsed += gameTime.ElapsedGameTime.TotalMilliseconds;
        }

        public new virtual void Draw(GameTime gameTime)
        {
            if (!IsVisible) return;
            if (Texture == null) return;

            SpriteBatch.Draw(Texture, Bounds, Color.White);
        }
    }
}